import request from '@/utils/request'

// 查询报价单列表
export function listQuotation(query) {
  return request({
    url: '/crm/quotation/list',
    method: 'get',
    params: query
  })
}

// 查询报价单详细
export function getQuotation(id) {
  return request({
    url: '/crm/quotation/' + id,
    method: 'get'
  })
}

// 新增报价单
export function addQuotation(data) {
  return request({
    url: '/crm/quotation',
    method: 'post',
    data: data
  })
}

// 修改报价单
export function updateQuotation(data) {
  return request({
    url: '/crm/quotation',
    method: 'put',
    data: data
  })
}

// 删除报价单
export function delQuotation(id) {
  return request({
    url: '/crm/quotation/' + id,
    method: 'delete'
  })
}

// 查询详细客户信息
export function getCustomerInfo(customerName) {
  return request({
    url: '/crm/customer/customer/' + customerName,
    method: 'get'
  })
}

// 查询详细的跟进记录
export function getFollowRecord(customerName) {
  return request({
    url: '/crm/record/name/' + customerName,
    method: 'get'
  })
}

// 查询联系人的详细信息
export function getContact(customerName) {
  return request({
    url: '/crm/person/contact/' + customerName,
    method: 'get'
  })
}


// 根据联系人姓名查询联系人的详细信息
export function getContactByTelName(telName) {
  return request({
    url: '/crm/person/contact/telname/' + telName,
    method: 'get'
  })
}

// 获取公司首要联系人的详细信息
export function getFirstContactInfoByCustomerName(customerName) {
  return request({
    url: '/crm/person/contact/first/' + customerName,
    method: 'get'
  })
}

// 获取产品得详细信息
export function getProductInfoByName(productName) {
  return request({
    url: '/crm/product/info/' + productName,
    method: 'get'
  })
}

// 获取产品报价得详细信息
export function getQuatationProductInfoByName(customerName) {
  return request({
    url: '/crm/quotionproduct/' + customerName,
    method: 'get'
  })
}
